package models

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Username string `gorm:"varchar(30)" json:"username"`
	Password string `gorm:"varchar(30)" json:"password"`
}

// 角色表
type Role struct {
	gorm.Model
	RoleName string `gorm:"varchar(30)" json:"roleName"`
}

// 角色和用户关系表
type UserRole struct {
	gorm.Model
	Uid int `gorm:"int"`
	Rid int `gorm:"int"`
}

// 权限表
type Node struct {
	gorm.Model
	NodeName string `gorm:"varchar(30)"`
}

// 权限和角色关系表
type NodeRole struct {
	gorm.Model
	Nid int `gorm:"int"`
	Rid int `gorm:"int"`
}

// 仓库
type House struct {
	gorm.Model
	Title   string `gorm:"varchar(30)" json:"title"`
	Content string `gorm:"varchar(30)" json:"content"`
}

// 仓库订单表
type HouseOrder struct {
	gorm.Model
	Num   int `gorm:"int"`
	Price int `gorm:"int"`
	Hid   int `gorm:"int"`
}
type HouseList struct {
	OrderID int    `gorm:"int"`
	Title   string `gorm:"varchar(30)" json:"title"`
	Content string `gorm:"varchar(30)" json:"content"`
	Num     int    `gorm:"int"`
	Price   int    `gorm:"int"`
}

// 用户表
type UserList struct {
	gorm.Model
	Username string `gorm:"varchar(30)" json:"username"`
	Name     string `gorm:"varchar(30)" json:"name"`
	Sex      string `gorm:"varchar(30)" json:"sex"`
	Tel      string `gorm:"varchar(30)" json:"tel"`
	Email    string `gorm:"varchar(30)" json:"email"`
	Bm       string `gorm:"varchar(30)" json:"bm"`
	Status   string `gorm:"varchar(30)" json:"status"`
}
type UserKm struct {
	Name     string `gorm:"varchar(30)" json:"name"`
	Sex      string `gorm:"varchar(30)" json:"sex"`
	Tel      string `gorm:"varchar(30)" json:"tel"`
	Username string `gorm:"varchar(30)" json:"username"`
	Password string `gorm:"varchar(30)" json:"password"`
	Status   string `gorm:"varchar(30)" json:"status"`
}

// 车
type Car struct {
	gorm.Model
	Title string `gorm:"varchar(30)" json:"title"`
	Name  string `gorm:"varchar(30)" json:"name"`
}

type CarsOrder struct {
	gorm.Model
	Num   int `gorm:"varchar(30)" json:"num"`
	Price int `gorm:"varchar(30)" json:"price"`
	Cid   int `gorm:"int"`
}

type CarList struct {
	OrderID int    `gorm:"int"`
	Title   string `gorm:"varchar(30)" json:"title"`
	Name    string `gorm:"varchar(30)" json:"name"`
	Num     int    `gorm:"varchar(30)" json:"num"`
	Price   int    `gorm:"varchar(30)" json:"price"`
}
